package com.java.demo.controller;

import com.java.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/*
* 用户控制器
* 作者：A
* */
@Controller
public class UserController2 {
    @Autowired
    private User user;
    public void doMethod(){
        User user2 = user;
        System.out.println("User -> 修改之前 : user "+user);
        user2.setId(111);
        user2.setName("黑旋风");
        System.out.println("User -> 修改之后 : user "+user);
    }
}
